const counter = (now: any) => ({
  count: 0,
  add() {
    const { count } = now(); // <---- get own model
    now({ count: count + 1 }); // <-- set own model
  },
});

// 商家分类
const typeAll = (now: any) => ({
  typeAll: {},
  typeAllChange(data: any) {
    now({ typeAll: data });
  },
});
// 详情数据
const detailData = (now: any) => ({
  detailData: {},
  detailDataChange(data: any) {
    now({ detailData: data });
  },
});

// 新生专区下单数据
const nsOrderParams = (now: any) => ({
  nsOrderParams: {
    name: '',
    studentNum: '',
    telInput: '',
    height: '',
    weight: '',
    size: '',
    tel:'',
    schoolType:0,
    postage:'',
    idCard:'',
  },
  nsOrderParamsChange(data: any) {
    now({ nsOrderParams: data });
  },
});


const nsTelInfo = (now: any) => ({
  nsTelInfo: {
    cont:''
  },
  nsTelInfoChange(data: any) {
    now({ nsTelInfo: data });
  },
});

export default {
  counter,
  typeAll,
  detailData,
  nsOrderParams,
  nsTelInfo
};

/*
  使用
    import useModel from 'flooks';
    import store from '@/stores/index'
    import effects from '@/stores/effects'
    const { count, add } = useModel(store.counter, ['count']); 
    const { addLater } = useModel(effects.trigger);
*/
